export const menuTab = [
  {
    title: "取消数据",
    key: "1",
  },
  {
    title: "确认数据",
    key: "2",
  },
];

export const listdata = [
  {
    id: "1",
    no: "JDX63321",
    status: "WAIT_FINISH",
    deviceName: "设备点检记录",
    deviceNo: "0000141",
    beginTime: "2020-06-01",
    submitTime: " 2020-09-23",
    totalTime: "10",
    result: "合格",
    classes: "白班",
    executor: "王小明",
  },
  {
    id: "2",
    status: "WAIT_FINISH",
    deviceName: "设备点检记录2",
    deviceNo: "0000141",
    beginTime: "2020-06-01",
    submitTime: " 2020-09-23",
    totalTime: "10",
    result: "合格",
    classes: "白班",
    executor: "王小明",
  },
];

const STATUS_LIST = [
    {
      "label": "待确认",
      "value": "WAIT_CONFIRM"
  },
  {
      "label": "已确认",
      "value": "CONFIRMED"
  },
  {
      "label": "完成",
      "value": "COMPLETE",
      "remarks": "完成"
  },
  {
      "label": "待审核",
      "value": "WAIT_CHECK"
  }
];

const getcolor = (status) => {
  if (status == "WAIT_FINISH" || status == "CANCEL_TO_BE_CONFIRMED") {
    return "WAIT_FINISH";
  } else if (status == "PROCESSING" || status == "REPAIRING") {
    return "PROCESSING";
  } else if (status == "REPAIRED_TO_BE_CONFIRMED") {
    return "REPAIRED_TO_BE_CONFIRMED";
  }
};

export const listFields = {
  title: {
    label: "单据号",
    value: "no",
  },
  children: [
    {
      label: "状态",
      value: "status",
      statusList: STATUS_LIST,
      statusColor: getcolor,
    },
    {
      label: "申请人",
      value: "createName",
    },
    {
      label: "创建时间",
      value: "createTime",
    },
  ],
};
